//
//  HMSportTracking.h
//  BlackHorseLine
//
//  Created by made on 17/3/5.
//  Copyright © 2017年 made. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "HMSportTrackingLine.h"
#import <UIKit/UIKit.h>
#import <MAMapKit/MAMapKit.h>

//运动类型枚举
typedef NS_ENUM(NSInteger,HMSportType)
{
    HMSportTypeWalk = 1, //设置枚举的第一个值为1,默认是0
    HMSportTypeRun,
    HMSportTypeBike,
};



//运动状态枚举
typedef NS_ENUM(NSInteger,HMSportState)
{
    HMSportStateContinue = 1, //设置枚举的第一个值为1,默认是0
    HMSportStatePause,
    HMSportStateFinish,
};


//GPS信号枚举
typedef NS_ENUM(NSInteger,HMSportGPSSignalState)
{
    HMSportGPSSignalStateDisconnect = 1, //断开
    HMSportGPSSignalStateStateBad,  //差
    HMSportGPSSignalStateStateNormal,  //一般
    HMSportGPSSignalStateStateGood,  //好
};


//GPS信号变更宏
#define kHMSportGPSSignalStateChange @"kHMSportGPSSignalStateChange"

@interface HMSportTracking : NSObject



/**
 初始化运动模型

 @param type 运动模型
 @return 运动模型
 */
- (instancetype)initWithSportType:(HMSportType)type;


/**
 初始化运动状态模型

 @param type 运动模型
 @param state 状态模型
 @return 运动状态模型
 */
- (instancetype)initWithSportType:(HMSportType)type SportState:(HMSportState)state;


//运动类型
@property(nonatomic,assign,readonly)HMSportType sportType;
//运动状态
@property(nonatomic,assign)HMSportState sportState;
//运动起点
@property(nonatomic,strong)CLLocation *sportStartLocation;
//大头针图像
@property(nonatomic,assign,readonly)UIImage *sportImage;
//运动起点
@property(nonatomic,strong,readonly)CLLocation *startLocation;
//运动轨迹折线模型数组
@property(strong,nonatomic)NSMutableArray<HMSportTrackingLine *> *trackingLineArr;

/**
 绘制轨迹折线
 @param location 位置
 @return 折线对象
 */
-(HMSportPolyLine *)drawPolylineWithLocation:(CLLocation *)location;

//GPS信号状态
@property(nonatomic,assign,readonly)HMSportGPSSignalState gpsSignalState;

//运动总距离 单位:km
@property(nonatomic,assign,readonly)double totalDistance;
//运动总时间 单位:s
@property(nonatomic,assign,readonly)double totalTime;
//运动总时间字符串 00:00:00
@property(nonatomic,strong,readonly)NSString *totaTimeStr;
//运动平均速度 单位:km/h
@property(nonatomic,assign,readonly)double avgSpeed;
//运动最大速度 单位:km/h
@property(nonatomic,assign,readonly)double maxSpeed;



@end
